import time
from selenium import webdriver
from selenium.webdriver.edge.service import Service
from lxml import etree

service = Service()
service.path = r'chromedriver.exe'
# 启动浏览器
browser = webdriver.Chrome(service=service)

# 让浏览器发起一个指定url对应请求
browser.get('https://haokan.baidu.com/v?vid=7245305555322059123&tab=recommend')

# page_source 获取浏览器当前页面的页面源码数据
page_text = browser.page_source

tree = etree.HTML(page_text)

mp4_lst = tree.xpath('//*[@id="mse"]/div[2]/video/@src')

print(mp4_lst)

browser.quit()

time.sleep(10)

